-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix JavaFX thread exception when fetching new infos #4354
Conversation
Fixes #4348 by reworking the SwingWorker using JavaFX BackgroundTasks.
} | ||
}) | ||
.onFailure(exception -> { | ||
LOGGER.error("Error while fetching entry with " + fetcher.getName(), exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use {} for parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not possible if the last argument should be treated as an exception.
if (fetcher.isPresent()) { | ||
return fetcher.get().performSearchById(fieldContent.get()); | ||
} else { | ||
return Optional.<BibEntry>empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally you don't need the genericc type in return Optional.empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also surprised but it leads to compiler errors without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one TODO left.
Otherwise looks good.
this.dialogService = panel.frame().getDialogService(); | ||
this.panel = panel; | ||
|
||
// TODO: Don't run this method as part of the constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you resolve this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was just too lazy to do it ;-). Fixed now.
# Conflicts: # src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java
* upstream/master: Update Libraries (#4366) ArXiv fetcher support http url (#4367) Fix issue 3861 : XMP Dialog, Add new Groups dialog, Append Library dialog to javafx (#4264) fix IndexOutOfBoundsException when saving preferences group RadioButtons in ExportSortingPrefsTab to prevent the selection of multiple or no order types Convert Part of the Issue#3861 Quality->Cleanup entries (#4268) UPDATE gradle to 4.10.2 (#4358) Completed General Fields Customizer conversion to JavaFX (#4346) Fix JavaFX thread exception when fetching new infos (#4354) Auto trim url field (#4355) Fix freezes in entry editor (#4351) # Conflicts: # src/main/java/org/jabref/preferences/PreferencesService.java
Fixes JavaFX thread exceptions by reworking the SwingWorker using JavaFX BackgroundTasks.